package com.ctrl.riveradministrator.mvp.presenter;

import android.util.Log;

import com.ctrl.riveradministrator.base.BaseObserver;
import com.ctrl.riveradministrator.base.BasePresenter;
import com.ctrl.riveradministrator.mvp.model.Drain;
import com.ctrl.riveradministrator.mvp.model.Suggest;
import com.ctrl.riveradministrator.mvp.view.activity.river_doc.DrainView;
import com.ctrl.riveradministrator.mvp.view.activity.suggest.SuggestView;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class DrainPresenter extends BasePresenter<DrainView> {

    public DrainPresenter(DrainView baseView) {
        super(baseView);
    }


    public void getDrains(String id) {
        Map<String, String> map = new HashMap<>();
        map.put("id", id);
        attachView(apiService.getDrain(map), new BaseObserver<Drain>(getBaseView()) {
            @Override
            public void onSuccess(Drain model) {
                getBaseView().showMessage(model);
            }

            @Override
            public void onSuccess(List<Drain> model) {
               // getBaseView().showMessage(model);
            }

            @Override
            public void onFailed(String msg) {
                Log.d("onFailed", ":" + msg);
            }

        });
    }


}